<template>
	<view>
		<view class="set-box">
			<view class="item" @click="navTo('./pwd')">
				<view class="left">
					<text class="text">修改登录密码</text>
				</view>
				<image class="right" src="../../../static/images/right_arrow.png" mode="aspectFill"></image>
			</view>
		</view>
		<div class="common-btn">
			<button class="cu-btn block bg-green margin-tb-sm lg" @click="logout">退出登录</button>
		</div>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		methods: {
			logout(){
				uni.setStorageSync('AppToken',null);
				uni.navigateBack({
				  success: () => {
					let page = getCurrentPages().pop();  //跳转页面成功之后
					if (!page) return;
					let options = {
					  xx:""  //例如上一页面是id为2的数据,要传递回去
					}
					page.onLoad(options);
				  }
				})
			},
			navTo(url){
				uni.navigateTo({
					url: url
				})
			} 
		}
	}
</script>

<style scoped lang="scss">
.set-box{
	margin-top: 30upx;
	background: #fff;
	padding: 0 40upx;
	.item{
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 25upx 0;
		.left{
			display: flex;
			align-items: center;
			.text{
				font-size:30upx;
				color: #666;
			}
		}
		.right{
			width: 20upx;
			height: 34upx;
		}
	}
}

</style>
